﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Text;
using Universum.Model.Domain;
namespace Universum.Infrastructure.Persistence.Queries
{
	public class UserWithUsernameAndPassword : IDomainQuery<Universum.Model.Domain.User>
	{
		private string _username;

		public string Username
		{
			get { return _username; }
			set { _username = value; }
		}
		private string _password;

		public string Password
		{
			get { return _password; }
			set { _password = value; }
		}
		public UserWithUsernameAndPassword(string username, string password)
		{
			Username = username;
			Password = password;
			update_expression();
		}

		private void update_expression()
		{
			StringBuilder sb = new StringBuilder();
			Expression = user => user.Username.Equals(Username) &&
				user.Password.Equals(Password);
		}
		#region IDomainQuery<User> Members

		public System.Linq.Expressions.Expression<Func<Universum.Model.Domain.User, bool>> Expression
		{
			get; private set; 
		}

		#endregion
	}
}
